package com.lyf.boot.modules.index.entity;

import com.lyf.boot.base.system.entity.SysPerm;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * 菜单树
 * @author Luyufan
 * @date 2023/7/6 11:21
 */
@Data
@Accessors(chain = true)
@AutoMapper(target = SysPerm.class)
public class MenuTreeVo implements Serializable {

    @Serial
    private static final long serialVersionUID = -3013027209551529398L;

    /**
     * 权限id
     */
    public Long permId;

    /**
     * 路径
     */
    private String path;

    /**
     * 重定向地址
     */
    private String redirect;

    /**
     * 组件名
     */
    private String name;

    /**
     * 组件
     */
    private String component;

    /**
     * 父级权限id
     */
    private Long parentId;

    /**
     * 子权限
     */
    private List<MenuTreeVo> children;

    private Meta meta;

    @Data
    public static class Meta implements Serializable{

        @Serial
        private static final long serialVersionUID = 6569665780038462138L;
        /**
         * 标题
         */
        private String title;
        /**
         * 图标
         */
        private String icon;
        /**
         * 排序
         */
        private Integer order;

        /**
         * 是否忽略KeepAlive缓存
         */
        private Boolean keepAlive;

        /**
         * 内嵌iframe的地址
         */
        private String iframeSrc;

        /**
         * 外链地址
         */
        private String link;

        private List<String> authority;

        private String badge;

        private String badgeType;

        private String badgeVariants;

        private Boolean affixTab;

        private Integer affixTabOrder;

        private Boolean openInNewWindow;

        private Boolean noBasicLayout;
    }

}
